package com.singfan.core.dao.database.model.constant;

/**
 * Author: hansonghe
 * Date: 2015-08-27 12:15
 * Desc:
 */
public class OrderStatusType {
    /**
     * 未支付
     */
    public static final int UNPAID = 1;

    /**
     * 逾期未支付
     */
    public static final int PAY_EXPIRED = 2;

    /**
     * 已支付
     */
    public static final int PAID = 3;

    /**
     * 完成服务
     */
    public static final int SERVICED = 4;

    /**
     * 退款处理中
     */
    public static final int REFUNDING = 5;

    /**
     * 退款完成
     */
    public static final int REFUNDED = 6;

    /**
     * 投诉处理中
     */
    public static final int COMPLAINTING = 7;

    /**
     * 投诉完成
     */
    public static final int COMPLAINTED = 8;

    /**
     * 服务开始
     */
    public static final int SERVICE_START = 9;

    public static boolean isOrderStatusType(int value){
        return (value >= 1 && value <= 9);
    }

    public static String getOrderStatusText(int value){
        String text = "未知";
        if (value == UNPAID){
            text = "待支付";
        }
        else if (value == PAY_EXPIRED){
            text = "过期未支付";
        }
        else if (value == PAID){
            text = "未服务";
        }
        else if (value == SERVICED){
            text = "完成服务";
        }
        else if (value == SERVICE_START){
            text = "服务中";
        }
        else if (value == REFUNDED){
            text = "已退款";
        }

        return text;
    }
}
